package com.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.common.utils.PageUtils;
import com.common.utils.Query;
import com.dao.ScoreDao;
import com.entity.ScoreEntity;
import com.service.ScoreService;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service("scoreService")
public class ScoreServiceImpl extends ServiceImpl<ScoreDao, ScoreEntity> implements ScoreService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<ScoreEntity> page = this.page(
                new Query<ScoreEntity>().getPage(params),
                new QueryWrapper<ScoreEntity>()
                        .or().like("examcode", params.get("key"))
                        .or().like("studentid", params.get("key"))
                        .or().like("subject", params.get("key"))
                        .or().like("answerdate", params.get("key"))
        );

        return new PageUtils(page);
    }

}